package com.one.blocks.common.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author linfuxin Created on 2022-02-14 10:41:32
 */
@ApiModel(value = "分页参数")
@Data
@ToString(callSuper = true)
public class PageRequest implements Serializable {

    /**
     * 当前页
     */
    @NotNull
    @Min(1)
    @Max(1000_000)
    @ApiModelProperty(value = "当前页", required = true, example = "1")
    private Integer pageNum;

    /**
     * 分页大小
     */
    @NotNull
    @Min(1)
    @Max(1000_000)
    @ApiModelProperty(value = "每页数量", required = true, example = "20")
    private Integer pageSize;

    /**
     * 查询总记录数（默认 true）
     */
    @ApiModelProperty(value = "统计总记录数", example = "false")
    private boolean searchCount = true;
}